import json
import re

def merge_list(lst:list):
    return [item for sublist in lst for item in sublist]

j = open('ZH_CN.json','r',encoding='utf8')
data:list = json.load(j)
zh_arr = merge_list(data)

zh_snbt = open('zh_cn.snbt','a',encoding='utf8')
en_snbt = open('en_us.snbt','r')
for line in en_snbt:
    a = line.find('"')
    b = line.rfind('"')
    if a != -1 and b != -1:
        res = line[:a+1] + zh_arr[0] + line[b:]
        zh_snbt.write(res)
        zh_arr.pop(0)
        continue
    else:
        zh_snbt.write(line)
